﻿<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" xmlns:th="http://www.thymeleaf.org">
<!--<![endif]-->
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>智能养老云平台-修改密码</title>
    <link rel="shortcut icon" type="image/x-icon" th:href="@{/static/favicon.ico}">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link th:href="@{/static/css/regist.css}" rel="stylesheet" >
    <link rel="stylesheet" th:href="@{/static/plugins/layui/css/layui.css}">
    <style>
       .submit{
           width: 200px!important;
       }

        .layui-form-item {
            margin-bottom: 30px!important;
        }
    </style>
</head>
<body>
<!--[if lt IE 7]>
        <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
    <![endif]-->
    <div class="wrap">
        <nav class="site-navbar navbar navbar-default navbar-fixed-top navbar-inverse " role="navigation" style="background: #4e97d9;line-height:60px;padding-left:30px;color:#fff;">
		    <div class="navbar-header" style="font-size:20px">智能养老云平台</div>
		</nav>
        <div class="registMain">
            <!--  //机构注册  -->
            <div class="form-box" >
                <p>
                    <a class="title">养老机构修改密码</a>
                    <span class="fr">已有账号，<a class="acolor" th:href="@{/login}">去登录</a></span>
                </p>
                <form class="layui-form" lay-filter="myform" th:action="@{/changePassword/updatePassword}" method="post" >
                    <div class="layui-form-item">
                        <label class="layui-form-label">新密码</label>
                        <div class="layui-input-inline">
                            <input type="password" name="password" id="password" lay-verify="password" placeholder="请输入新密码" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-mid layui-word-aux">由6-16位字母数字及_ $ ! ?组成</div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">再次输入</label>
                        <div class="layui-input-inline">
                            <input type="password" name="password2" lay-verify="password2" placeholder="确认密码" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn layui-btn-normal submit" lay-submit lay-filter="subBtn">确认</button>
                        </div>
                    </div>
                </form>
            </div>
        </div><!-- //main -->
        <div class="foot">
            <div class="copyRight color666"> &copy; 2018  智能养老云平台 </div>
        </div><!-- //foot -->

    </div><!-- //wrap -->
    <script th:src="@{/static/plugins/jquery.js}"></script>
    <script th:src="@{/static/plugins/validate/jquery.validate.min.js}"></script>
    <script th:src="@{/static/plugins/layui/layui.js}"></script>
<script>
    layui.use(["form","layer"],function(){
        var $ = layui.$,
            form = layui.form,
            layer = layui.layer;

        //表单验证
        form.verify({
            password: function (value1) { //value：表单的值、item：表单的DOM对象
                if (value1 === "" || value1 == null || value1.length < 6 || value1.length > 16) {
                    return '密码必须是6-16位';
                } else {
                    var pswd = /^[0-9a-zA-Z_$!?]{6,16}$/;
                    if (!pswd.test(value1)) {
                        return "您输入的密码不符合规则，请从新输入"
                    }
                }
            },
            password2: function (value2) { //value：表单的值、item：表单的DOM对象
                if (value2 !== $("#password").val()) {
                    return '两次密码输入不一致';
                }
            }
        });


    });
</script>
</body>
</html>
